﻿#pragma once

#ifndef ARD_COMMON_H
#define ARD_COMMON_H

#include <functional>
#include <mutex>
#include <iostream>
#include <thread>
#include <iomanip>
#include <ctime>
#include <chrono>
#include <coroutine> //C++ 20 协程库
#include <unordered_map>

#include <utils/Log.h>

#define TAG "COMMON"

extern void cleanup();
extern inline std::string get_format_time(const char* format);
extern std::mutex logMtx;
//todo 退出一些内容
#define Abort(x) do{\
	LogE(x);\
	cleanup();\
	exit(255);\
	}\
	while (0)


//打印枚举值
template<typename T>
typename std::underlying_type<T>::type printEnum(T const value) {
	return static_cast<typename std::underlying_type<T>::type>(value);
}

#endif // !ARD_COMMON_H
